package top.shiyiri.exercise;

import top.shiyiri.preparedstatement.PreparedStatementUpdateTest;

import java.util.Scanner;

/**
 * @author Aunean
 * @date 2022/1/19 16:51
 */
public class ExerciseTest2 {

    //向examstudent表中添加一条记录
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("四级/六级：");
        int type = sc.nextInt();
        System.out.println("身份证号：");
        String IDCard = sc.next();
        System.out.println("准考证号：");
        String examCard = sc.next();
        System.out.println("学生姓名：");
        String studentName = sc.next();
        System.out.println("所在城市：");
        String location = sc.next();
        System.out.println("考试成绩：");
        int grade = sc.nextInt();

        String sql = "insert into examStudent(type, IDCard, examCard, studentName, location, grade) values(?,?,?,?,?,?)";
        PreparedStatementUpdateTest.update(sql, type, IDCard, examCard, studentName, location, grade);
    }
}
